﻿using System.Text;

namespace Project.Co_DataTransformationPrototype
{
    public abstract class MappingBase
    {
        protected EventContext eventContext;
        protected StringBuilder strSQLMapping = new StringBuilder();

        /// <summary>
        /// Get the SQL code for the model element associated with this state
        /// </summary>
        public virtual StringBuilder GetSQLCodeMapping
        {
            get { return strSQLMapping; }
        }

        public virtual StringBuilder SetSQLCodeMapping
        {
            set { strSQLMapping = value; }
        }

        internal virtual EventContext EventContext
        {
            get { return eventContext; }
            set { eventContext = value; }
        }

        internal abstract void generateSQLCodeMapping(StringBuilder existingScript = null);

        internal virtual MappingBase handle(MappingBase newMapping)
        {
            newMapping.generateSQLCodeMapping(this.strSQLMapping);
            return newMapping;
        }

    }
}
